lappend auto_path ../../pkg/TMD
package require TMD
#namespace import ::TMD::*

Interface create mbuild
# set base dir for the interface
mbuild setDir testInterfacewithmBuild

# set input
mbuild log input cmd.log
mbuild log output stdout
mbuild loglevel input 1 0
mbuild loglevel output 1 2
mbuild compressOutput

mbuild openChannel /usr/local/bin/mbuild
# if get expected response, then send new information and output the result.
# The whole output before the expected result is stored in a local variable 'buffer'.
# The sentence that matched with the expected result is stored in a local variable 'matched'.
mbuild expect {
            files  { my send dielx_H.dx; puts "Buffer:\n+++++++++\n$buffer+++++++++\n";exp_continue;}
            R0= { my send 10; puts "Matched string:\n+++++++++\n$matched+++++++++\n"; exp_break}
}

# list current directory
puts "After the test, we have following files under the directory:
=======================
[exec ls]
======================="
# rm everything
#exec rm -r testInterfacewithmBuild
